//
//  ViewController.m
//  raceme
//
//  Created by mac on 2021/9/3.
//

#import "ViewController.h"
#import "YZInAppPurchaseViewCtl.h"

@interface ViewController ()
@property(nonatomic,strong)UILabel * payLab;
@end


@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view addSubview:self.payLab];
}




-(UILabel *)payLab {
    if (_payLab == nil) {
        _payLab = [[UILabel alloc] initWithFrame:CGRectMake(100, 100, 100, 100)];
        _payLab.text = @"to Pay";
        _payLab.textAlignment = NSTextAlignmentCenter;
        _payLab.font = [UIFont systemFontOfSize:16];
        _payLab.layer.cornerRadius = 3;
        _payLab.layer.masksToBounds = YES;
        _payLab.layer.borderWidth = 0.5;
        _payLab.layer.borderColor = [UIColor blueColor].CGColor;
        _payLab.textColor = [UIColor blueColor];
        _payLab.userInteractionEnabled = YES;
        UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] init];
        [[tap rac_gestureSignal] subscribeNext:^(__kindof UIGestureRecognizer * _Nullable x) {
            YZInAppPurchaseViewCtl * vc = [[YZInAppPurchaseViewCtl alloc] init];
            [self.navigationController pushViewController:vc animated:YES];
        }];
        [_payLab addGestureRecognizer:tap];
    }
    return _payLab;
}

@end

